package com.job51.hro.datacheckservice.util;

import java.util.List;
import java.util.Random;

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author pengfei.ma
 * @create 2022/11/14
 * @since 1.0.0
 */
public class ListUtil {

    public static String randomStr(List<String> arr) {
        if (arr != null && arr.size() > 0) {
            //获取随机下标
            int index = new Random().nextInt(arr.size());
            return arr.get(index);
        } else {
            return "";
        }
    }
}
